package com.good.serviceImp;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.good.dao.Test1DemoDao;
import com.good.datasource.DbContextHolder;
import com.good.datasource.DbType;
import com.good.entity.Test1;
import com.good.service.Test1DemoService;
@Service("test1DemoServiceImpl")
@Transactional
public class Test1DemoServiceImpl extends BaseServiceImpl<Test1, Long> implements Test1DemoService{
	@Resource(name="test1DemoDaoImpl")
	private Test1DemoDao test1DemoDao;
	@Resource(name="test1DemoDaoImpl")
	public void setBaseDao(Test1DemoDao baseDao) {
		// TODO Auto-generated method stub
		super.setBaseDao(baseDao);
	}
	@Override
	public void save(Test1 entity) {
		DbContextHolder.setDbType(DbType.REPLICA1); 
		super.save(entity);
		DbContextHolder.clearDbType();
	} 
}
